<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div>
			<h1>  好好学习</h1>
			<p>通过标签名获取节点</p>
		</div>
		
		<div>
			<h1>天天向上</h1>
			<p>通过标签名获取节点</p>
		</div>
		
		
		<script type="text/javascript">
			
			let tt = document.getElementsByTagName('h1')[1];
			alert(tt.textContent)
			
		</script>
	</body>
</html>
